<%--
  Created by IntelliJ IDEA.
  User: Lt
  Date: 2018/5/17
  Time: 22:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>

<title>会员 - 档案</title>

<link rel="stylesheet" href="${contextPath}/static/ace/components/_mod/jquery-ui/jquery-ui.css"/>
<link rel="stylesheet"
      href="${contextPath}/static/ace/components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css"/>
<link rel="stylesheet" href="${contextPath}/static/ace/components/_mod/jqgrid/ui.jqgrid.css"/>
<%--<jsp:include page="../../head.jsp"/>--%>
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.min.js"></script>
<script src="${contextPath}/static/statistics/js/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="${contextPath}/static/statistics/js/vue.js"></script>
<script src=${contextPath}/static/layer/layui.all.js></script>
<script src="${contextPath}/static/countjs/regularYz.js"></script>
<script src="${contextPath}/static/franchisee/form.js"></script>

<style type="text/css">
    .customBtn {
        line-height: 20px;
        margin-bottom: 3px;
    }

    .btnLine {
        margin-left: 1px;
        margin-top: 8px;
        margin-bottom: 2px;
    }
	select {
	    padding-top: 0px;
	    padding-bottom:0px;
	}
    @-webkit-keyframes bouncedelay {
        0%, 80%, 100% {
            -webkit-transform: scale(0.0)
        }
        40% {
            -webkit-transform: scale(1.0)
        }
    }

    @keyframes bouncedelay {
        0%, 80%, 100% {
            transform: scale(0.0);
            -webkit-transform: scale(0.0);
        }
        40% {
            transform: scale(1.0);
            -webkit-transform: scale(1.0);
        }
    }

    .autocomplete-suggestions {
        border: 1px solid #999;
        background: #FFF;
        overflow: auto;
    }

    .autocomplete-suggestion {
        padding: 2px 5px;
        white-space: nowrap;
        overflow: hidden;
    }

    .autocomplete-selected {
        background: #F0F0F0;
    }

    .autocomplete-suggestions strong {
        font-weight: normal;
        color: #3399FF;
    }

    @-moz-document url-prefix() {
        fieldset {
            display: table-cell;
        }
    }

    .ui-jqgrid-sortable {
        text-align: center;
    }
</style>
<div class="row" id="appAlert">
    <div class="row btnLine">
        <div class="button-len col-sm-12">
            <div style="width: 100%; margin-bottom: 10px;">
                <button class="btn btn-white btn-sm btn-purple customBtn"  v-on:click="addmembers">
                    <i class="ace-icon fa fa-plus-circle purple"></i> 新增
                </button>
                <button class="btn btn-white btn-info btn-sm customBtn" id="editmembers">
                    <i class="ace-icon fa fa-pencil blue"></i> 修改
                </button>
                <%--<button class="btn btn-white btn-info btn-sm customBtn" id="deleteSupplier">--%>
                    <%--<i class="ace-icon fa fa-key red"></i> 删除--%>
                <%--</button>--%>
                <button class="btn btn-white btn-info btn-sm customBtn" id="editState">
                    <i class="ace-icon fa fa-key red"></i> 修改状态
                </button>
                <%--<label style="">状态</label>--%>
                <%--<select class="input-sm" id="state1">--%>
                    <%--<option selected="selected" value="1">新建</option>--%>
                    <%--<option value="2">正常</option>--%>
                    <%--<option value="3">业务冻结</option>--%>
                    <%--<option value="4">财务冻结</option>--%>
                    <%--<option value="4">停用</option>--%>
                <%--</select>--%>
                <%--<button class="btn btn-white btn-info btn-sm customBtn" id="">--%>
                    <%--<i class="ace-icon fa fa-key red"></i> 复制--%>
                <%--</button>--%>
                <%--<button class="btn btn-white btn-info btn-sm customBtn" id="">--%>
                    <%--<i class="ace-icon fa fa-key red"></i> 打印--%>
                <%--</button>--%>
                <%--<button class="btn btn-white btn-info btn-sm customBtn" id="">--%>
                    <%--<i class="ace-icon fa fa-key red"></i> 导出--%>
                <%--</button>--%>
                <%--<button class="btn btn-white btn-info btn-sm customBtn" id="">--%>
                    <%--<i class="ace-icon fa fa-key red"></i> 设置--%>
                <%--</button>--%>
                <%--<button class="btn btn-white btn-info btn-sm customBtn" id="">--%>
                    <%--<i class="ace-icon fa fa-key red"></i> 退出--%>
                <%--</button>--%>
            </div>
            <input class="input-sm" type="text" id="_shopName" style="margin-left: 0px;" value=""
                   placeholder="店铺名称">
            <button class="btn btn-sm btn-white btn-info search-len customBtn"
                    onclick="searchMember()">
                <i class="ace-icon fa fa-search orange"></i>搜索
            </button>
        </div>
    </div>
    <!-- 内容数据开始 -->
    <div class="col-xs-12" style="text-align: center;">
        <table class="center" id="grid-table"></table>

        <div id="grid-pager"></div>

    </div>

    <!-- 内容数据结束 -->

    <!-- 新增模态框（Modal） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width: 800px;">
            <div class="modal-content">
                <div class="modal-header" style="font-size: 20px; margin-bottom: -15px;">
                    <h4 class="modal-title" id="myModalLabel">
                        会员 - <span id="alertTitle">新增</span>
                        <small id="smallTitle" class="hide" style="color: red; float: right; margin-top: 10px;"></small>

                    </h4>
                </div>
                <div class="modal-body">
                    <div class="row" style="margin-top: 5px; margin-left: 0px;">
                        <button class="btn btn-white btn-info btn-sm customBtn btn-xs" id="dv_button1" style="border-radius: 10px;" type="button" v-on:click="tableShow">基础信息</button>
                        <button class="btn btn-white btn-info btn-sm customBtn btn-xs" id="dv_button2" type="button" v-on:click="businessLicenseShow">其他信息</button>
                        <button class="btn btn-white btn-info btn-sm customBtn btn-xs" id="dv_button3" type="button" v-on:click="licenceShow">图片</button>
                    </div>
                    <div id="UpdatePanel1">
                        <form id="memberFormId">
                            <table class="NewSpdaTb" style="height: 390px" cellpadding="0" cellspacing="0">
                            <%--<tbody><tr>--%>
                                <%--<td style="height: 37px; vertical-align: bottom;">--%>
                                    <%--<div style="white-space: nowrap; margin-left: 15px;">--%>
                                        <%--<input type="submit" name="btnBaseInfo" value="基本信息" onclick="if(!ShowIsDiv(1,'btnBaseInfo')) return false;" id="btnBaseInfo" class="TbButton1">--%>
                                        <%--<input type="submit" name="btnOtherInfo" value="其他信息" onclick="if(!ShowIsDiv(2,'btnOtherInfo')) return false;" id="btnOtherInfo" class="TbButton">--%>
                                        <%--<input type="submit" name="btnPicture" value="图片" onclick="if(!ShowIsDiv(5,'btnPicture')) return false;" id="btnPicture" class="TbButton">--%>
                                        <%--&lt;%&ndash;<input type="submit" name="btnExtraInfo" value="附加信息" onclick="if(!ShowIsDiv(6,'btnExtraInfo')) return false;" id="btnExtraInfo" class="TbButton">&ndash;%&gt;--%>
                                        <%--&lt;%&ndash;<input type="submit" name="btnVipLabel" value="标签" onclick="if(!ShowIsDiv(9,'btnVipLabel')) return false;" id="btnVipLabel" class="TbButton">&ndash;%&gt;--%>
                                    <%--</div>--%>
                                <%--</td>--%>
                            <%--</tr>--%>
                            <tr>
                                <td style="height: 380px; position: relative; z-index: auto;">
                                    <div id="NewAddSpda" class="NewAddSpda" style="height: 380px; width: 735px; border: solid 1px #F5F5F5;">
                                        <div id="divBlock1" style="display: block;">
                                            <table style="width: 100%; height: 348px" border="0" cellpadding="0" cellspacing="0">
                                                <tbody>
                                                <tr>
                                                    <input name="id" type="text" id="id" class="TextBox hide" onfocus="this.select();" title=""  style="width: 130px; height: 20px;text-align: right; display: none;" value="">
                                                    <td align="right" width="100px">会员等级：
                                                    </td>
                                                    <td align="left" style="width: 138px">
                                                        <select name="card_type" id="card_type" style="width: 130px; height: 20px;text-align: right" _value="09">
                                                            <option selected="selected" value="01">===易购普卡===</option>
                                                            <option value="02">===易购绿卡===</option>
                                                            <option value="03">===易购红卡===</option>
                                                            <option value="04">===易购金卡===</option>
                                                            <option value="05">===易购黑卡===</option>
                                                        </select>
                                                    </td>
                                                    <td align="right" style="width: 90px">会员ID：
                                                    </td>
                                                    <td align="left" style="width: 150px">
                                                        <input name="userId" type="text" id="userId" class="TextBox" onfocus="this.select();" title="会员ID和会员卡号不允许有 +,-,×,% 等特殊的符号" onblur="if(checkObject(this,8)){return false;}" onkeyup="limitLength(this,20);validateInputValue(this,'');" style="width: 130px; height: 20px;text-align: right" value="" readonly>
                                                    </td>
                                                    <td align="right" style="width: 120px;">会员卡号：
                                                    </td>
                                                    <td align="left" style="width: 150px">
                                                        <input name="cardNo" type="text" id="cardNo" class="TextBox" title="" style="width: 130px; height: 20px;text-align: right" value="" readonly>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">姓名：
                                                    </td>
                                                    <td align="left">
                                                        <input name="userName" type="text" id="userName" class="TextBox" onblur="getHelpCode(this)" onkeyup="limitLength(this,20);" onfocus="this.select();" autocomplete="off" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                    <td align="right">密码：
                                                    </td>
                                                    <td align="left">
                                                        <input name="pass" type="password" id="pass" class="TextBox" onkeyup="limitLength(this,19);" onfocus="this.select();" autocomplete="off" value="" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                    <td align="right">重复密码：
                                                    </td>
                                                    <td align="left">
                                                        <input name="pass2" type="password" id="pass2" class="TextBox" onkeyup="limitLength(this,19);" onfocus="this.select();" autocomplete="off" value="" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">助 记 码：
                                                    </td>
                                                    <td align="left">
                                                        <input name="txtZJM" type="text" id="txtZJM" class="TextBox" onkeyup="limitLength(this,10)" style="width: 130px; height: 20px; text-align: right;" _value="">
                                                    </td>
                                                    <td align="right">
                                                        手机号码：
                                                    </td>
                                                    <td align="left">
                                                        <input name="mobile" type="text" id="mobile" class="TextBox" style="width: 130px; height: 20px;text-align: right" _value="" data-container="body" data-toggle="popover" data-placement="right" data-content="顶部的 Popover 中的一些内容" datatype="s5-16" errormsg="昵称至少5个字符,最多16个字符！" >
                                                    </td>
                                                    <td align="right">
                                                         <%--手机：--%>
                                                    </td>
                                                    <td align="left">
                                                        <%--<input name="mobile" type="text" id="mobile" class="TextBox" onkeyup="limitLength(this,11);" onblur="if(checkObject(this,16)){return false;}" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">--%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">性别：
                                                    </td>
                                                    <td align="left">
                                                        <table id="vip_sex" border="0">
                                                            <tbody>
                                                                <tr>
                                                                    <td>
                                                                        <input id="gender_0" type="radio" name="gender" value="1" checked="checked" _value="true">
                                                                        <label for="gender_0">男</label>
                                                                    </td>
                                                                    <td width="100px">
                                                                        <input id="gender_1" type="radio" name="gender" value="2" _value="false" style="margin-left: 10px;">
                                                                        <label for="gender_1">女</label>
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                    <td align="right">会费：
                                                    </td>
                                                    <td align="left">
                                                        <input name="vip_tax" type="text" value="0.00" maxlength="10" id="vip_tax" class="TextBox" onkeyup="checkObject(this,5)" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="0.00">
                                                    </td>
                                                    <td align="right">入会日期：
                                                    </td>
                                                    <td align="left">

                                                        <table cellspacing="0" cellpadding="0">
                                                            <tbody><tr>
                                                                <td>
                                                                    <input name="oper_date$txtBeginDate" type="text" id="oper_date_txtBeginDate" class="TextBox" onfocus="new WdatePicker(this,'%Y-%M-%D',false,'whyGreen');this.select();" style="width: 130px; height: 20px;text-align: right" onblur="checkDate(this)" size="130" value="" _value="">
                                                                </td>

                                                            </tr>
                                                            </tbody></table>

                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">生日：
                                                    </td>
                                                    <td align="left">

                                                        <table cellspacing="0" cellpadding="0">
                                                            <tbody><tr>
                                                                <td>
                                                                    <input name="birthday$txtBeginDate" type="text" id="birthday_txtBeginDate" class="TextBox" onfocus="new WdatePicker(this,'%Y-%M-%D',false,'whyGreen');this.select();" style="width: 130px; height: 20px;text-align: right" onblur="checkDate(this)" size="130" _value="" realvalue="">
                                                                </td>

                                                            </tr>
                                                            </tbody></table>

                                                        <input name="txthiddate" type="text" id="txthiddate" style="display: none">
                                                    </td>
                                                    <td align="right">公历：
                                                    </td>
                                                    <td align="left">
                                                        <select name="bth_flag" id="bth_flag" style="width:130px; height: 20px; text-align: right;" _value="0">
                                                            <option selected="selected" value="0">公历</option>
                                                            <option value="1">农历</option>

                                                        </select>
                                                    </td>
                                                    <td align="right">
                                                        e-mail：
                                                    </td>
                                                    <td align="left">
                                                        <input name="vip_email" type="text" id="vip_email" class="TextBox" onkeyup="limitLength(this,30);" onblur="if(checkObject(this,29)){return false;}" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">年龄：
                                                    </td>
                                                    <td align="left">
                                                        <input name="age" type="text" maxlength="2" id="age" disabled="disabled" class="TextBox" onblur="checkObject(this,21)" style="width:130px;text-align: right" _value="">
                                                    </td>
                                                    <td align="right">余额：
                                                    </td>
                                                    <td align="left">
                                                        <input name="residual_amt" type="text" value="0.00" id="residual_amt" disabled="disabled" class="TextBox" onkeyup="limitLength(this,20);" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="0.00">
                                                    </td>
                                                    <td align="right" title="累计消费次数">消费次数：
                                                    </td>
                                                    <td align="left">
                                                        <input name="consum_count" type="text" value="0.00" maxlength="10" id="consum_count" disabled="disabled" class="TextBox" onkeyup="checkObject(this,2)" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="0.00">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right" title="累计消费金额">消费总额：
                                                    </td>
                                                    <td align="left">
                                                        <input name="consum_amt" type="text" value="0.00" maxlength="10" id="consum_amt" disabled="disabled" class="TextBox" onkeyup="checkObject(this,5)" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="0.00">
                                                    </td>
                                                    <td align="right">累计积分：
                                                    </td>
                                                    <td align="left">
                                                        <input name="acc_num" type="text" value="0.00" maxlength="10" id="acc_num" disabled="disabled" class="TextBox" onkeyup="checkObject(this,5)" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="0.00">
                                                    </td>
                                                    <td align="right">已用积分：
                                                    </td>
                                                    <td align="left">
                                                        <input name="dec_num" type="text" value="0.00" maxlength="10" id="dec_num" disabled="disabled" class="TextBox" onkeyup="checkObject(this,5)" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="0.00">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">剩余积分：
                                                    </td>
                                                    <td align="left">
                                                        <input name="now_acc_num" type="text" value="0.00" maxlength="10" id="now_acc_num" disabled="disabled" class="TextBox" onkeyup="checkObject(this,5)" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="0.00">
                                                    </td>
                                                    <td align="right">限用次数：
                                                    </td>
                                                    <td align="left">
                                                        <input name="use_num" type="text" value="99,999.00" maxlength="20" id="use_num" disabled="disabled" class="TextBox" onkeyup="checkObject(this,5)" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="99,999.00">
                                                    </td>
                                                    <td align="right">状态：
                                                    </td>
                                                    <td align="left">
                                                        <select name="state" id="state" style="width: 130px; height: 20px;text-align: right" _value="0">
                                                            <option selected="selected" value="0">正常</option>
                                                            <option value="1">无效</option>
                                                            <option value="2">挂失</option>
                                                            <option value="3">作废</option>
                                                            <option value="4">黑名单</option>
                                                        </select>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right" style="width: 90px;">
                                                        <%--积分有效期：--%>
                                                    </td>
                                                    <td>

                                                        <table cellspacing="0" cellpadding="0">
                                                            <tbody><tr>
                                                                <td>
                                                                    <%--<input name="vip_start_date$txtBeginDate" type="text" id="vip_start_date_txtBeginDate" class="TextBox" onfocus="new WdatePicker(this,'%Y-%M-%D',false,'whyGreen');this.select();" style="width: 130px; height: 20px;text-align: right" onblur="checkDate(this)" size="130" value="2018-06-05" _value="2018-06-05">--%>
                                                                </td>

                                                            </tr>
                                                            </tbody></table>

                                                    </td>
                                                    <td align="center">
                                                        <%--到--%>
                                                    </td>
                                                    <td align="left">

                                                        <table cellspacing="0" cellpadding="0">
                                                            <tbody><tr>
                                                                <td>
                                                                    <%--<input name="vip_end_date$txtBeginDate" type="text" id="vip_end_date_txtBeginDate" class="TextBox" onfocus="new WdatePicker(this,'%Y-%M-%D',false,'whyGreen');this.select();" style="width: 130px; height: 20px;text-align: right" onblur="checkDate(this)" size="130" value="2020-06-05" _value="2020-06-05">--%>
                                                                </td>

                                                            </tr>
                                                            </tbody></table>

                                                    </td>
                                                    <td align="right">发卡人：
                                                    </td>
                                                    <td align="left">


                                                        <div style="white-space: nowrap;">
                                                            <div class="sisc_ucShowWrap">
                                                                <input name="ucOperman$txtShow" type="text" value="" id="ucOperman_txtShow" class="ucShowTxt" readonly="readonly" onkeydown="if(event.keyCode==13){ if(document.getElementById('ucOperman_txtName')!=null){BaseCodeHidQuery(this.id,'ucOperman_txtName', 'ucOperman_btnOpen','User','VipInfo','',''); event.stopPropagation(); }else{BaseCodeHidQuery(this.id,'','ucOperman_btnOpen','User','VipInfo','','');} return false; }" onblur="if(trim(this.value)==''){document.getElementById('ucOperman_txtNO').value='';  if(document.getElementById('ucOperman_txtName')!=null){document.getElementById('ucOperman_txtName').value='';} }" _value="[1001]Justin" tabindex="-1" style="width: 130px; height: 20px;text-align: right;background-color: rgb(236, 231, 216);">
                                                                <input type="submit" name="ucOperman$btnNO" value="..." id="ucOperman_btnNO" disabled="disabled" class="ucShowNo" onclick="var nameID=''; if(document.getElementById('ucOperman_txtName')!=null){ nameID='ucOperman_txtName';}   OpenQueryWindow('','/EWBLD/CommonPage/UCBaseCode.aspx?UCBaseType=User&amp;BtnID=ucOperman_hidQuery&amp;PageName=VipInfo&amp;HidButtonID=&amp;FilterCondition=&amp;txtShow=ucOperman_txtShow&amp;txtNO=ucOperman_txtNO&amp;txtOtherID=&amp;txtName='+nameID);return false;">
                                                            </div>
                                                            <input name="ucOperman$txtNO" type="text" value="1001" id="ucOperman_txtNO" class="sheettextno" readonly="readonly" onkeydown="if(event.keyCode==13){ if(document.getElementById('ucOperman_txtName')!=null){BaseCodeHidQuery(this.id,'ucOperman_txtName', 'ucOperman_btnOpen','User','VipInfo','',''); event.stopPropagation(); }else{BaseCodeHidQuery(this.id,'','ucOperman_btnOpen','User','VipInfo','','');} return false; }" onblur="if(trim(this.value)==''){ if(document.getElementById('ucOperman_txtName')!=null){document.getElementById('ucOperman_txtName').value='';} } if(checkObject(this,6)){return false;}" title="请输入操作员的编码" style="width: 130px; height: 20px;text-align: right;background-color:#ECE7D8;width:165px;display: none;">
                                                            <img src="../../Images/comm_Search.png" id="ucOperman_imgNO" class="ImgShow" onmouseover="this.style.cursor='hand'" style="width: 130px; height: 20px;text-align: right;display: none;" disabled="disabled" onclick="var nameID=''; if(document.getElementById('ucOperman_txtName')!=null){ nameID='ucOperman_txtName';}   OpenQueryWindow('','/EWBLD/CommonPage/UCBaseCode.aspx?UCBaseType=User&amp;BtnID=ucOperman_hidQuery&amp;PageName=VipInfo&amp;HidButtonID=&amp;FilterCondition=&amp;txtShow=ucOperman_txtShow&amp;txtNO=ucOperman_txtNO&amp;txtOtherID=&amp;txtName='+nameID);return false;">
                                                            <input name="ucOperman$txtName" type="text" value="Justin" id="ucOperman_txtName" class="sheettextname" unselectable="on" readonly="readonly" style="width: 130px; height: 20px;text-align: right;background-color:#ECE7D8;display: none;">
                                                            <input type="submit" name="ucOperman$btnOpen" value=""  style="width: 130px; height: 20px;text-align: right;display: none">
                                                            <input type="submit" name="ucOperman$hidQuery" value="" id="ucOperman_hidQuery" style="display: none">
                                                            <input name="ucOperman$HidBranchType" type="text" id="ucOperman_HidBranchType" class="sheettextno" style="width:55px;display: none;">
                                                        </div>

                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">
                                                    </td>
                                                    <td>

                                                        <table cellspacing="0" cellpadding="0">
                                                            <tbody><tr>
                                                                <td>
                                                                    <%--<input name="sav_start_date$txtBeginDate" type="text" id="sav_start_date_txtBeginDate" class="TextBox" onfocus="new WdatePicker(this,'%Y-%M-%D',false,'whyGreen');this.select();" style="width:130px;" onblur="checkDate(this)" size="130" value="2018-06-05" _value="2018-06-05">--%>
                                                                </td>

                                                            </tr>
                                                            </tbody></table>

                                                    </td>
                                                    <td align="center">
                                                    </td>
                                                    <td align="left">

                                                        <table cellspacing="0" cellpadding="0">
                                                            <tbody><tr>
                                                                <td>
                                                                    <%--<input name="sav_end_date$txtBeginDate" type="text" id="sav_end_date_txtBeginDate" class="TextBox" onfocus="new WdatePicker(this,'%Y-%M-%D',false,'whyGreen');this.select();" style="width:130px;" onblur="checkDate(this)" size="130" value="2020-06-05" _value="2020-06-05">--%>
                                                                </td>

                                                            </tr>
                                                            </tbody></table>

                                                    </td>
                                                    <td align="right">发卡分店：
                                                    </td>
                                                    <td align="left">
                                                        <div style="white-space: nowrap;">
                                                            <div class="sisc_ucShowWrap">
                                                                <input name="shopId" type="text" maxlength="2" id="shopId" disabled="disabled" class="TextBox hide" style="width:130px; height: 24px; text-align: right" value="">
                                                                <input name="shoName" type="text" maxlength="2" id="shopName" disabled="disabled" class="TextBox" style="width:130px; height: 24px; text-align: right" value="">
                                                                <input type="button" name="" value="..." id="getShop" class="ucShowNo" onclick="requireShopNameFu()">
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">修改人：
                                                    </td>
                                                    <td align="left">
                                                        <input name="modify_name" type="text" id="modify_name" disabled="disabled" class="TextBox" style="width: 130px; height: 20px;text-align: right" _value="">
                                                        <input name="modify_oper" type="text" id="modify_oper" style="display: none">
                                                    </td>
                                                    <td align="right">修改时间：
                                                    </td>
                                                    <td>
                                                        <input name="modify_date" type="text" id="modify_date" disabled="disabled" class="TextBox" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                    <td align="right">
                                                        <input name="save_amt" type="text" value="0.00" maxlength="12" id="save_amt" disabled="disabled" class="TextBox" style="width:130px;display: none">
                                                        父卡ID：
                                                    </td>
                                                    <td align="left">
                                                        <input name="father_card" type="text" id="father_card" class="TextBox" onkeyup="limitLength(this,20);" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>

                                                </tr>
                                                <tr>
                                                    <td align="right">营业员：
                                                    </td>
                                                    <td align="left">

                                                        <div style="white-space: nowrap;">
                                                            <div class="sisc_ucShowWrap">
                                                                <input name="ucSaleman$txtShow" type="text" id="ucSaleman_txtShow" class="ucShowTxt" onkeydown="if(event.keyCode==13){ if(document.getElementById('ucSaleman_txtName')!=null){BaseCodeHidQuery(this.id,'ucSaleman_txtName', 'ucSaleman_btnOpen','Saleman','AddTarget','',''); event.stopPropagation(); }else{BaseCodeHidQuery(this.id,'','ucSaleman_btnOpen','Saleman','AddTarget','','');} return false; }" onblur="if(trim(this.value)==''){document.getElementById('ucSaleman_txtNO').value='';  if(document.getElementById('ucSaleman_txtName')!=null){document.getElementById('ucSaleman_txtName').value='';} }" _value="" style="width: 130px; height: 20px;text-align: right">
                                                                <input type="submit" name="ucSaleman$btnNO" value="..." onclick="var nameID=''; if(document.getElementById('ucSaleman_txtName')!=null){ nameID='ucSaleman_txtName';}   OpenQueryWindow('','/EWBLD/CommonPage/UCBaseCode.aspx?UCBaseType=Saleman&amp;BtnID=ucSaleman_hidQuery&amp;PageName=AddTarget&amp;HidButtonID=&amp;FilterCondition=&amp;txtShow=ucSaleman_txtShow&amp;txtNO=ucSaleman_txtNO&amp;txtOtherID=&amp;txtName='+nameID);return false;" id="ucSaleman_btnNO" class="ucShowNo">
                                                            </div>
                                                            <input name="ucSaleman$txtNO" type="text" id="ucSaleman_txtNO" class="sheettextno" onkeydown="if(event.keyCode==13){ if(document.getElementById('ucSaleman_txtName')!=null){BaseCodeHidQuery(this.id,'ucSaleman_txtName', 'ucSaleman_btnOpen','Saleman','AddTarget','',''); event.stopPropagation(); }else{BaseCodeHidQuery(this.id,'','ucSaleman_btnOpen','Saleman','AddTarget','','');} return false; }" onblur="if(trim(this.value)==''){ if(document.getElementById('ucSaleman_txtName')!=null){document.getElementById('ucSaleman_txtName').value='';} } if(checkObject(this,6)){return false;}" title="请输入营业员的编码" style="width:130px;display: none;">
                                                            <img src="../../Images/comm_Search.png" id="ucSaleman_imgNO" class="ImgShow" onmouseover="this.style.cursor='hand'" style="display: none;" onclick="var nameID=''; if(document.getElementById('ucSaleman_txtName')!=null){ nameID='ucSaleman_txtName';}   OpenQueryWindow('','/EWBLD/CommonPage/UCBaseCode.aspx?UCBaseType=Saleman&amp;BtnID=ucSaleman_hidQuery&amp;PageName=AddTarget&amp;HidButtonID=&amp;FilterCondition=&amp;txtShow=ucSaleman_txtShow&amp;txtNO=ucSaleman_txtNO&amp;txtOtherID=&amp;txtName='+nameID);return false;">

                                                            <input type="submit" name="ucSaleman$btnOpen" value="" onclick="var nameID='';if(document.getElementById('ucSaleman_txtName')!=null){ nameID='ucSaleman_txtName';}  OpenQueryWindow('ucSaleman_txtNO','/EWBLD/CommonPage/UCBaseCode.aspx?UCBaseType=Saleman&amp;BtnID=ucSaleman_hidQuery&amp;PageName=AddTarget&amp;HidButtonID=&amp;FilterCondition=&amp;txtShow=ucSaleman_txtShow&amp;txtNO=ucSaleman_txtNO&amp;txtOtherID=&amp;txtName='+nameID); return false;" id="ucSaleman_btnOpen" style="display: none">
                                                            <input type="submit" name="ucSaleman$hidQuery" value="" id="ucSaleman_hidQuery" style="display: none">
                                                            <input name="ucSaleman$HidBranchType" type="text" id="ucSaleman_HidBranchType" class="sheettextno" style="width:55px;display: none;">
                                                        </div>

                                                    </td>
                                                    <td align="right" style="width: 150px;">挂账信誉额度：
                                                    </td>
                                                    <td align="left">
                                                        <input name="txtCreditAmt" type="text" value="0.00" maxlength="10" id="txtCreditAmt" class="TextBox" onkeyup="checkObject(this,5)" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="0.00">
                                                    </td>
                                                    <td align="right">推荐人卡ID：
                                                    </td>
                                                    <td align="left">

                                                        <div style="white-space: nowrap;">
                                                            <div class="sisc_ucShowWrap">
                                                                <input name="txtReferrerId$txtShow" type="text" id="txtReferrerId_txtShow" class="ucShowTxt" onkeydown="if(event.keyCode==13){ if(document.getElementById('txtReferrerId_txtName')!=null){BaseCodeHidQuery(this.id,'txtReferrerId_txtName', 'txtReferrerId_btnOpen','VipInfo','NULL','',''); event.stopPropagation(); }else{BaseCodeHidQuery(this.id,'','txtReferrerId_btnOpen','VipInfo','NULL','','');} return false; }" onblur="if(trim(this.value)==''){document.getElementById('txtReferrerId_txtNO').value=''; if(document.getElementById('txtReferrerId_txtName')!=null){document.getElementById('txtReferrerId_txtName').value='';} }}" _value="" style="width: 130px; height: 20px;text-align: right">
                                                                <input type="submit" name="txtReferrerId$btnNO" value="..." onclick="var nameID=''; if(document.getElementById('txtReferrerId_txtName')!=null){ nameID='txtReferrerId_txtName';}   OpenQueryWindow('','/EWBLD/CommonPage/UCBaseCode.aspx?UCBaseType=VipInfo&amp;BtnID=txtReferrerId_hidQuery&amp;PageName=NULL&amp;HidButtonID=&amp;FilterCondition=&amp;txtShow=txtReferrerId_txtShow&amp;txtNO=txtReferrerId_txtNO&amp;txtOtherID=&amp;txtName='+nameID);return false;" id="txtReferrerId_btnNO" class="ucShowNo">
                                                            </div>
                                                            <%--<input name="txtReferrerId$txtNO" type="text" id="txtReferrerId_txtNO" class="sheettextno" onkeydown="if(event.keyCode==13){ if(document.getElementById('txtReferrerId_txtName')!=null){BaseCodeHidQuery(this.id,'txtReferrerId_txtName', 'txtReferrerId_btnOpen','VipInfo','NULL','',''); event.stopPropagation(); }else{BaseCodeHidQuery(this.id,'','txtReferrerId_btnOpen','VipInfo','NULL','','');} return false; }" onblur="if(trim(this.value)==''){ if(document.getElementById('txtReferrerId_txtName')!=null){document.getElementById('txtReferrerId_txtName').value='';} }}" title="请输入会员ID" style="width:160px;display: none;">--%>
                                                            <%--<img src="../../Images/comm_Search.png" id="txtReferrerId_imgNO" class="ImgShow" onmouseover="this.style.cursor='hand'" style="display: none;" onclick="var nameID=''; if(document.getElementById('txtReferrerId_txtName')!=null){ nameID='txtReferrerId_txtName';}   OpenQueryWindow('','/EWBLD/CommonPage/UCBaseCode.aspx?UCBaseType=VipInfo&amp;BtnID=txtReferrerId_hidQuery&amp;PageName=NULL&amp;HidButtonID=&amp;FilterCondition=&amp;txtShow=txtReferrerId_txtShow&amp;txtNO=txtReferrerId_txtNO&amp;txtOtherID=&amp;txtName='+nameID);return false;">--%>

                                                            <%--<input type="submit" name="txtReferrerId$btnOpen" value="" onclick="var nameID='';if(document.getElementById('txtReferrerId_txtName')!=null){ nameID='txtReferrerId_txtName';}  OpenQueryWindow('txtReferrerId_txtNO','/EWBLD/CommonPage/UCBaseCode.aspx?UCBaseType=VipInfo&amp;BtnID=txtReferrerId_hidQuery&amp;PageName=NULL&amp;HidButtonID=&amp;FilterCondition=&amp;txtShow=txtReferrerId_txtShow&amp;txtNO=txtReferrerId_txtNO&amp;txtOtherID=&amp;txtName='+nameID); return false;" id="txtReferrerId_btnOpen" style="display: none">--%>
                                                            <%--<input type="submit" name="txtReferrerId$hidQuery" value="" id="txtReferrerId_hidQuery" style="display: none">--%>
                                                            <%--<input name="txtReferrerId$HidBranchType" type="text" id="txtReferrerId_HidBranchType" class="sheettextno" style="width:55px;display: none;">--%>
                                                        </div>

                                                    </td>

                                                </tr>
                                                <tr>
                                                    <td id="showGWQAmtTxt" align="right" title="领购券金额" style="display:none;">领购券金额：
                                                    </td>

                                                    <td id="showGWQAmtInp" align="left" style="display:none;">
                                                        <input name="txtGWQAmt" type="text" value="0" maxlength="10" id="txtGWQAmt" disabled="disabled" class="TextBox" onkeyup="checkObject(this,5)" onfocus="this.select();" style="width:130px;text-align: right" _value="0">
                                                    </td>

                                                    <td align="right" title="是否为微会员">
                                                        <%--是否为微会员：--%>
                                                    </td>
                                                    <td align="left">
                                                        <%--<span disabled="disabled"><input id="isWXVip" type="checkbox" name="isWXVip" disabled="disabled" _value="false"></span>--%>
                                                    </td>

                                                </tr>

                                                </tbody></table>
                                        </div>
                                        <div id="divBlock2" class="SpdaDivVip hide">
                                            <table style="width: 100%; height: 348px" border="0" cellpadding="0" cellspacing="0">
                                                <tbody><tr>
                                                    <td align="right" style="width: 95px;">证件选择：
                                                    </td>
                                                    <td align="left" colspan="5">

                                                        <table id="vip_credentials" border="0">
                                                            <tbody><tr>
                                                                <td style="width: 66px;">
                                                                    <input id="vip_credentials_0" type="radio" name="vip_credentials" value="1" checked="checked" _value="true">
                                                                    <label for="vip_credentials_0">身份证</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="vip_credentials_1" type="radio" name="vip_credentials" value="2" _value="false" style="">
                                                                    <label for="vip_credentials_1">军官证</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="vip_credentials_2" type="radio" name="vip_credentials" value="3" _value="false">
                                                                    <label for="vip_credentials_2">驾照</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="vip_credentials_3" type="radio" name="vip_credentials" value="4" _value="false">
                                                                    <label for="vip_credentials_3">护照</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="vip_credentials_4" type="radio" name="vip_credentials" value="5" _value="false">
                                                                    <label for="vip_credentials_4">学生证</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="vip_credentials_5" type="radio" name="vip_credentials" value="6" _value="false">
                                                                    <label for="vip_credentials_5">其他</label>
                                                                </td>
                                                            </tr>
                                                            </tbody></table>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">证件号：
                                                    </td>
                                                    <td align="left" style="width: 100px;">
                                                        <input name="certNo" type="text"  id="certNo" class="TextBox" style="width: 130px; height: 20px;text-align: right" _value=""  data-container="body" data-toggle="popover" data-placement="right" data-content="顶部的 Popover 中的一些内容" />
                                                    </td>
                                                    <td align="right" style="width: 100px;">婚姻状况：
                                                    </td>
                                                    <td align="left" style="width: 100px;">
                                                        <select name="marriage" id="marriage" style="width: 130px; height: 20px;text-align: right" _value="未婚">
                                                            <option selected="selected" value="未婚">未婚</option>
                                                            <option value="已婚">已婚</option>
                                                            <option value="曾婚">曾婚</option>
                                                        </select>
                                                    </td>

                                                </tr>
                                                <tr>
                                                    <td align="right">民族：
                                                    </td>
                                                    <td align="left">
                                                        <select name="nation" id="nation" style="width: 130px; height: 20px;text-align: right" _value="汉">
                                                            <option selected="selected" value="汉">汉</option>
                                                            <option value="满">满</option>
                                                            <option value="蒙">蒙</option>
                                                            <option value="回">回</option>
                                                            <option value="藏">藏</option>
                                                            <option value="壮">壮</option>
                                                            <option value="其他">其他</option>

                                                        </select>
                                                    </td>
                                                    <td align="right">文化程度：
                                                    </td>
                                                    <td align="left">
                                                        <input name="degree" type="text" id="degree" class="TextBox" onkeyup="limitLength(this,20);" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                    <td align="right">邮编：
                                                    </td>
                                                    <td align="left">
                                                        <input name="vip_zip" type="text" id="vip_zip" class="TextBox" onkeyup="limitLength(this,10);" onblur="if(checkObject(this,30)){return false;}" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">职业选择：
                                                    </td>
                                                    <td align="left" colspan="5">

                                                        <table id="rblwork" border="0">
                                                            <tbody>
                                                            <tr>
                                                                <td style="width: 66px;">
                                                                    <input id="rblwork_0" type="radio" name="rblwork" value="1" _value="false">
                                                                    <label for="rblwork_0">法人代表</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="rblwork_1" type="radio" name="rblwork" value="2" _value="false">
                                                                    <label for="rblwork_1">企业管理者</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="rblwork_2" type="radio" name="rblwork" value="3" _value="false">
                                                                    <label for="rblwork_2">公务员</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="rblwork_3" type="radio" name="rblwork" value="4" _value="false">
                                                                    <label for="rblwork_3">教师</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="rblwork_4" type="radio" name="rblwork" value="5" _value="false">
                                                                    <label for="rblwork_4">职员</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="rblwork_5" type="radio" name="rblwork" value="6" _value="false">
                                                                    <label for="rblwork_5">军人</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="rblwork_6" type="radio" name="rblwork" value="7" _value="false">
                                                                    <label for="rblwork_6">学生</label>
                                                                </td>
                                                                <td style="width: 66px;">
                                                                    <input id="rblwork_7" type="radio" name="rblwork" value="8" checked="checked" _value="true">
                                                                    <label for="rblwork_7">其他</label>
                                                                </td>
                                                            </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">出生地：
                                                    </td>
                                                    <td align="left">
                                                        <input name="homeplace" type="text" id="homeplace" class="TextBox" onkeyup="limitLength(this,20);" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                    <td align="right">户口所在地：
                                                    </td>
                                                    <td align="left">
                                                        <input name="reg_place" type="text" id="reg_place" class="TextBox" onkeyup="limitLength(this,20);" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                    <td align="right">居住地：
                                                    </td>
                                                    <td align="left">
                                                        <input name="live_place" type="text" id="live_place" class="TextBox" onkeyup="limitLength(this,20);" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">收入水平：
                                                    </td>
                                                    <td align="left">
                                                        <select name="salary_level" id="salary_level" style="width: 130px; height: 20px;text-align: right" _value="0">
                                                            <option value="0">保密</option>
                                                            <option value="1">1000以下</option>
                                                            <option value="2">1000-3000</option>
                                                            <option value="3">3000-5000</option>
                                                            <option value="4">5000-8000</option>
                                                            <option value="5">10000以上</option>

                                                        </select>
                                                    </td>
                                                    <td align="right">身高(cm)：
                                                    </td>
                                                    <td align="left">
                                                        <input name="height" type="text" maxlength="3" id="height" class="TextBox" onkeyup="checkObject(this,2)" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                    <td align="right">体重(kg)：
                                                    </td>
                                                    <td align="left">
                                                        <input name="weight" type="text" id="weight" class="TextBox" onkeyup="checkObject(this,5);limitDataLength(this,3);" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">血型：
                                                    </td>
                                                    <td align="left">
                                                        <select name="blood_type" id="blood_type" style="width: 130px; height: 20px;text-align: right" _value="A">
                                                            <option selected="selected" value="A">A</option>
                                                            <option value="B">B</option>
                                                            <option value="AB">AB</option>
                                                            <option value="O">O</option>

                                                        </select>
                                                    </td>
                                                    <td align="right">爱好：
                                                    </td>
                                                    <td align="left" colspan="3">
                                                        <input name="favor" type="text" id="favor" class="TextBox" onkeyup="limitLength(this,50);" onfocus="this.select();" style="width: 130px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">备注：
                                                    </td>
                                                    <td align="left" colspan="5">
                                                        <input name="memo" type="text" id="memo" class="TextBox" onkeyup="limitLength(this,250);" onfocus="this.select();" style="width: 581px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">来店动机：
                                                    </td>
                                                    <td align="left" colspan="5">
                                                        <table id="vip_intent" border="0">
                                                            <tbody>
                                                            <tr>
                                                                <td style="width: 56px;">
                                                                    <input id="vip_intent_0" type="radio" name="vip_intent" value="1" _value="false">
                                                                    <label for="vip_intent_0">促销</label>
                                                                </td>
                                                                <td style="width: 80px;">
                                                                    <input id="vip_intent_1" type="radio" name="vip_intent" value="2" checked="checked" _value="true">
                                                                    <label for="vip_intent_1">服务满意</label>
                                                                </td>
                                                                <td style="width: 80px;">
                                                                    <input id="vip_intent_2" type="radio" name="vip_intent" value="3" _value="false">
                                                                    <label for="vip_intent_2">朋友介绍</label>
                                                                </td>
                                                                <td style="width: 80px;">
                                                                    <input id="vip_intent_3" type="radio" name="vip_intent" value="4" _value="false">
                                                                    <label for="vip_intent_3">店内环境</label>
                                                                </td>
                                                                <td style="width: 56px;">
                                                                    <input id="vip_intent_4" type="radio" name="vip_intent" value="5" _value="false">
                                                                    <label for="vip_intent_4">路过</label>
                                                                </td>
                                                                <td style="width: 80px;">
                                                                    <input id="vip_intent_5" type="radio" name="vip_intent" value="6" _value="false">
                                                                    <label for="vip_intent_5">电视广告</label>
                                                                </td>
                                                                <td style="width: 80px;">
                                                                    <input id="vip_intent_6" type="radio" name="vip_intent" value="7" _value="false">
                                                                    <label for="vip_intent_6">亲友介绍</label>
                                                                </td>
                                                                <td style="width: 56px;">
                                                                    <input id="vip_intent_7" type="radio" name="vip_intent" value="8" _value="false">
                                                                    <label for="vip_intent_7">其它</label>
                                                                </td>
                                                            </tr>
                                                            </tbody>
                                                        </table>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">工作单位：
                                                    </td>
                                                    <td align="left" colspan="5">
                                                        <input name="company" type="text" id="company" class="TextBox" onkeyup="limitLength(this,40);" onfocus="this.select();" style="width: 581px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="right">详细地址：
                                                    </td>
                                                    <td align="left" colspan="5">
                                                        <input name="txtVipAdd" type="text" id="txtVipAdd" class="TextBox" onkeyup="limitLength(this,80);" onfocus="this.select();" style="width: 581px; height: 20px;text-align: right" _value="">
                                                    </td>
                                                </tr>
                                                </tbody></table>
                                        </div>
                                        <div id="divBlock3" class="row hide">
                                            <div style="margin:10px auto;border:1px solid #000;width:320px;height:240px;">
                                                <img id="showImageInfoImg" style="width:320px;height:240px;" src="" alt="..." class="img-thumbnail">
                                            </div>
                                            <p style="font-size: 12px; text-align: center;">图片显示(图片窗口大小为320*240，上传图片最佳宽高比例为4：3,图片大小限制在300K以内)</p>
                                            <div style="margin-top: 10px; text-align: center;">
                                                <input type="file" name="file" id="image_file_input" class="inputfile hide"/>
                                                <label for="image_file_input"><i class="ace-icon fa fa-folder-open"></i> 请选择图片</label>
                                            </div>
                                            <div style="margin-top: 10px; text-align: center;">
                                                <button class="btn btn-white btn-info btn-sm customBtn btn-xs" type="button" v-on:click="submitImg">上传</button>
                                                <button class="btn btn-white btn-info btn-sm customBtn btn-xs" type="button" v-on:click="">删除</button>
                                            </div>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        </form>
                    </div>
                </div>
                <div class="modal-footer">
                    <table id="table2" class="ShowTitilDom" width="100%" style="display:block">
                        <tbody>
                            <tr>
                                <td style="height: 30px; text-align: right">
                                    <button class="btn btn-white btn-info btn-sm customBtn btn-xs hide" id="shang1" type="button" v-on:click="tableShow">上一条</button>
                                    <button class="btn btn-white btn-info btn-sm customBtn btn-xs" id="xia1"  type="button" v-on:click="businessLicenseShow">下一条</button>

                                    <button class="btn btn-white btn-info btn-sm customBtn btn-xs hide" id="shang2" type="button" v-on:click="businessLicenseShow">上一条</button>
                                    <button class="btn btn-white btn-info btn-sm customBtn btn-xs hide" id="xia2"  type="button" v-on:click="licenceShow">下一条</button>

                                    <input type="submit" name="btnDown" value="" id="btnDown" disabled="disabled" class="PtButton" onclick="if(checkModificationAdd('btnDown')) return true;else return false;">
                                    <button class="btn btn-white btn-info btn-sm customBtn btn-xs" id="" type="button" v-on:click="savemembers">保  存</button>
                                    <button class="btn btn-white btn-info btn-sm customBtn btn-xs" data-dismiss="modal" type="button" v-on:click="close">关  闭</button>

                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <%--<button type="button" class="btn btn-default btn-xs" data-dismiss="modal" v-on:click="close">关闭</button>--%>
                    <%--<button type="button" class="btn btn-primary btn-xs" v-on:click="saveSupplier">提交更改</button>--%>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>

    <!--  模态框（Modal） -->
    <!-- 状态 -->
    <div id="container">
        <div id="example1" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <a class="close" data-dismiss="modal">×</a>
                        <h3>修改状态</h3>
                    </div>
                    <div class="modal-body">
                        <label style="">状态</label>
                        <select class="input-sm" id="state1">
                            <option selected="selected" value="1">有效</option>
                            <option value="0">无效</option>
                            <option value="2">业务冻结</option>
                            <option value="3">财务冻结</option>
                            <option value="4">停用</option>
                        </select>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default btn-xs" data-dismiss="modal" v-on:click="close">关闭</button>
                        <button type="button" class="btn btn-primary btn-xs" id="saveState">提交更改</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 店铺选择模态框（Modal） -->
    <div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel1">
                        <span id="alertTitle1">店铺选择</span>
                        <small id="smallTitle1" class="hide" style="color: red; float: right; margin-top: 10px;">哈哈哈</small>
                    </h4>
                </div>
                <div class="modal-body">
                    <label for="" style="">店铺类型：</label>
                    <select class="input-sm" id="shopType">
                        <option value="">请选择</option>
                        <option value="直营">直营</option>
                        <option value="加盟">加盟</option>
                    </select>

                    <input class="input-sm" type="text" id="shopName1" style="margin-left: 2px;" placeholder="店铺名称">
                    <button class="btn btn-sm btn-white btn-info search-len customBtn" onclick="searchShopInfo()">
                        <i class="ace-icon fa fa-search orange"></i>搜索
                    </button>
                    <div class="row" style="border: #1b1e21 solid 1px;">
                        <table id="grid-shop-table"></table>
                        <div id="grid-shop-pager"></div>
                    </div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <%--<button type="button" class="btn btn-primary btn-xs" v-on:click="saveSupplier">提交更改</button>--%>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>

<input type="text" name="fileStr" id="fileStr" style="display:none"/>
<input type="text" name="fileType" id="fileType" style="display:none"/>

<!-- page specific plugin scripts -->
<script type="text/javascript" src="${contextPath}/static/statistics/js/jquery.mockjax.js"></script>
<script type="text/javascript" src="${contextPath}/static/statistics/js/jquery.autocomplete.js"></script>
<!-- 公用变量 -->
<script type="text/javascript">

    var grid_selector = "#grid-table";
    var pager_selector = "#grid-pager";

    var grid_shop_selector = "#grid-shop-table";
    var pager_shop_selector = "#grid-shop-pager";

    var laypage = layui.laypage,
        layer = layui.layer
    laydate = layui.laydate;

    var img64 = "";

    var laypage = layui.laypage,
        layer = layui.layer
    laydate = layui.laydate;

    var queryModel = {
        //分页参数
        page: '1',
        rows: '10',
        //图片参数
    }

    $("#id").show();
    $("#showImageInfoImg").attr("src", img64);
    $("#showImageInfoImg1").attr("src", img64);

</script>

<!-- Vue实现 -->
<script type="text/javascript">
    var app = new Vue({
        el: '#appAlert',
        data: {
            objects: [],
        },
        methods: {
            getShop: function () {

            },
            tableShow: function () {
                $("#alertTitle").html("新增")
                $("#businessLicenseDiv").addClass("hide")
                $("#divBlock2").addClass("hide")
                $("#divBlock3").addClass("hide")
                $("#divBlock1").removeClass("hide")

                $("#dv_button3").css("border-radius", "0px")
                $("#dv_button2").css("border-radius", "0px")
                $("#dv_button1").css("border-radius", "10px")

                $("#shang1").addClass("hide")
                $("#xia2").addClass("hide")
                $("#shang2").addClass("hide")
                $("#xia1").removeClass("hide")
            },
            businessLicenseShow: function () {
                $("#alertTitle").html("其他信息")
                $("#divBlock1").addClass("hide")
                $("#divBlock3").addClass("hide")
                $("#divBlock2").removeClass("hide")

                $("#dv_button3").css("border-radius", "0px")
                $("#dv_button1").css("border-radius", "0px")
                $("#dv_button2").css("border-radius", "10px")

                $("#xia1").addClass("hide")
                $("#shang2").addClass("hide")
                $("#shang1").removeClass("hide")
                $("#xia2").removeClass("hide")
            },
            licenceShow: function () {
                $("#alertTitle").html("图片")
                $("#divBlock1").addClass("hide")
                $("#divBlock2").addClass("hide")
                $("#divBlock3").removeClass("hide")

                $("#dv_button1").css("border-radius", "0px")
                $("#dv_button2").css("border-radius", "0px")
                $("#dv_button3").css("border-radius", "10px")

                $("#xia1").addClass("hide")
                $("#shang1").addClass("hide")
                $("#xia2").addClass("hide")
                $("#shang2").removeClass("hide")
            },
            savemembers: function () {
                $("#alertTitle").html("新增")
                $("#businessLicenseDiv").addClass("hide")
                $("#licenceDiv").addClass("hide")
                $("#tableDiv").removeClass("hide")
                $("#smallTitle").addClass("hide")
                $("#showImageInfoImg").attr("src",img64)
                $("#showImageInfoImg1").attr("src",img64)

                queryObjects()
            },
            addmembers: function () {
                $("#alertTitle").html("新增")
                $("#businessLicenseDiv").addClass("hide")
                $("#licenceDiv").addClass("hide")
                $("#tableDiv").removeClass("hide")
                $("#smallTitle").addClass("hide")
                $("#showImageInfoImg").attr("src",img64)
                $("#showImageInfoImg1").attr("src",img64)
                var rowData = {}
                editmembers(rowData)
            },
            submitImg: function () {
                submitImg()
            },
            close: function () {
                $("#alertTitle").html("新增")
                $("#businessLicenseDiv").addClass("hide")
                $("#licenceDiv").addClass("hide")
                $("#tableDiv").removeClass("hide")
                $("#smallTitle").addClass("hide")
                $("#showImageInfoImg").attr("src",img64)
                $("#showImageInfoImg1").attr("src",img64)
            }
        }
    });
</script>

<!-- 方法调用 -->
<script type="text/javascript">

    //获取店铺
    var requireShopNameFu = function () {
        pageInit()
        $('#myModal1').modal('show');
    }

    /**
     * 搜索会员
     */
    function searchMember() {
        var shopName = $("#_shopName").val();
        jQuery(grid_selector).jqGrid('setGridParam', {
            postData: {
                "shopName": shopName
            }
        }).trigger("reloadGrid");
    }

    var submitImg = function () {
        var id = $("#id").val();
        var fileType = "";
        var imageFile = "";
        var fileStr = "";

        fileStr = $("#fileStr").val();
        fileType = $("#fileType").val();
        imageFile = $("#image_file_input")[0].files[0];

        if (fileType == "") {
            $("#smallTitle").html("提示：请选择上传图片");
            $("#smallTitle").removeClass("hide");
            return;
        }

        if (imageFile.size > 524288) {
            $("#smallTitle").html("封面图片不得大于512KB");
            $("#smallTitle").removeClass("hide");
            return
        }
        var index = fileStr.indexOf("base64,");

        if (index > 0) {
            fileStr = fileStr.substring(index + 7);
            var fileType = $("#fileType").val();
            fileType = fileType.substring(6);
            if (fileStart == '1'){
                $("#fileStr").val(fileStr);
                $("#fileType").val(fileType);
            }else if (fileStart == '2'){
                $("#fileStr1").val(fileStr);
                $("#fileType1").val(fileType);
            }
        }
        queryModel.fileStr = $("#fileStr").val();
        queryModel.fileType = $("#fileType").val();

        layer.load(1);
        $.ajax({
            type: 'POST',
            url: '${contextPath}/ktPurchase/submitImg',
            data: queryModel,
            dataType: 'json',
            success: function (data) {
                layer.closeAll('loading');
                if (data.success == false){
                    $("#smallTitle").html(data.message);
                    return
                }
                $("#smallTitle").html(data.message);
                $("#smallTitle").removeClass("hide");
                var dataArray = data.data;

                queryModel.extraData = dataArray;

//                //console.log(queryModel)
            },
            error: function (result) {
                layer.closeAll('loading');
                $("#smallTitle").html("上传失败！");
                $("#smallTitle").removeClass("hide");
            }
        });
    }

    var getSupplier = function (rowData) {
        $("#showImageInfoImg").attr("src",img64)
        $("#showImageInfoImg1").attr("src",img64)

        $("#createTime").val(rowData.createTime);
        $("#remark").val(rowData.remark);
        $("#lastShoppingTime").val(rowData.lastShoppingTime);
        $("#lastShopId").val(rowData.lastShopId);
        $("#lastShopName").val(rowData.lastShopName);
        $("#state").val(rowData.state);
        $("#extraData").val(rowData.extraData);
        $("#id").val(rowData.id);
        $("#shopId").val(rowData.shopId);
        $("#shopName").val(rowData.shopName);
        $("#userName").val(rowData.userName);
        $("#userId").val(rowData.userId);
        $("#age").val(rowData.age);
//        $('#wrap input[name="payMethod"]:checked ').val();
        $("#gender").val(rowData.gender);
        $("#modifyTime").val(rowData.modifyTime);
        $("#mobile").val(rowData.mobile);
    };


    var getObjects = function (dataArray) {

        if ($(".popover-content").html()){
            layer.msg("提示：请检查您的数据！")
            return
        }
        var obj = $("#memberFormId").serializeJson()
        console.log(obj)
        layer.load(1)
        $.ajax({
            url: '${contextPath}/ktSaleProject/saveMember',
            type: 'post',
            data: obj,
            success: function (data) {
                layer.closeAll('loading');
                if (data.success == false){
                    layer.msg("获取出错："+data.message)
                    return
                }

                $('#myModal').modal('hide');
                layer.msg("提示："+data.message);
                reload();
            },
            error: function (error) {
                layer.closeAll('loading')
            }
        })
    };
    var queryObjects = function () {

        var fileType = $("#fileType").val();
        if (fileType != "") {
            submitImg();
        }
        var mobile = $("#mobile").val();
        if(mobile == ''){
            layer.msg("提示：电话号码不能为空");
            return
        }

        queryModel.createTime = $("#createTime").val();
        queryModel.faceId = $("#lastShopId").val();
        queryModel.lastShopId = $("#lastShopId").val();
        queryModel.remark = $("#remark").val();
        queryModel.lastShoppingTime = $("#lastShoppingTime").val();
        queryModel.lastShopId = $("#lastShopId").val();
        queryModel.lastShopName = $("#lastShopName").val();
        queryModel.state = $("#state").val();
//        queryModel.extraData = $("#extraData").val();
        queryModel.id = $("#id").val();
        queryModel.shopId = $("#shopId").val();
        queryModel.userName = $("#userName").val();
        queryModel.userId = $("#userId").val();
        queryModel.age = $("#age").val();
        queryModel.gender = $('input[name="payMethod"]:checked ').val();
        queryModel.modifyTime = $("#modifyTime").val();
        queryModel.mobile = $("#mobile").val();

        getObjects(queryModel)
    }


    $('#beginTime').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0,
        minView: 2,
        showMeridian: 1,
        format: "yyyy-mm-dd",
//        startDate:new Date(),
    });


    $('#endTime').datetimepicker({
        language: 'zh-CN',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        forceParse: 0,
        minView: 2,
        showMeridian: 1,
        format: "yyyy-mm-dd",
//        startDate:new Date(),
    });

    /**
     * 弹窗内容
     * @param rowData
     */
    var editmembers = function (rowData) {
        $("#createTime").val(rowData.createTime);
        $("#remark").val(rowData.remark);
        $("#lastShoppingTime").val(rowData.lastShoppingTime);
        $("#lastShopId").val(rowData.lastShopId);
        $("#lastShopName").val(rowData.lastShopName);
        $("#state").val(rowData.state);
        $("#extraData").val(rowData.extraData);
        $("#id").val(rowData.id);
        $("#shopId").val(rowData.shopId);
        $("#shopName").val(rowData.shopName);
        $("#userName").val(rowData.userName);
        $("#userId").val(rowData.userId);
        $("#age").val(rowData.age);
        $("#gender").val(rowData.gender);
        $("#modifyTime").val(rowData.modifyTime);
        $("#mobile").val(rowData.mobile);

        var businessLicenseImage = !rowData.businessLicenseImage;
        var licenseImage = !rowData.licenseImage;
//        //console.log(!licenseImage)
        if (!businessLicenseImage) {
            $("#showImageInfoImg").attr("src", 'http://clouderp.skystorechain.com:20080/'+rowData.businessLicenseImage);
        }
        if (!licenseImage) {
            $("#showImageInfoImg1").attr("src", 'http://clouderp.skystorechain.com:20080/'+rowData.licenseImage);
        }

        $("#memberFormId").setForm(rowData);

        $('#myModal').modal('show');
    }

    var input = document.getElementById("image_file_input");
    if (typeof(FileReader) === 'undefined') {
        alert("抱歉，你的浏览器不支持 FileReader，请使用现代浏览器操作！");
        input.setAttribute('disabled', 'disabled');
    } else {
        input.addEventListener('change', readFile, false);
    }

    function readFile() {
        $("#smallTitle").addClass("hide");
        var file = this.files[0];
        if(file == undefined) {
            //layer.msg("发送内容过大，请检查图片和内容");
            $("#showImageInfoImg").attr("src",img64);
            $("#fileStr").val("");
            $("#fileType").val("");
            return;
        }
        //这里我们判断下类型如果不是图片就返回 去掉就可以上传任意文件
        if (!/image\/\w+/.test(file.type)) {
            layer.msg("请确保文件为图像类型");
            return false;
        }
        var reader = new FileReader();
        reader.readAsDataURL(file);
        reader.onload = function (e) {
            $("#fileStr").val(this.result);
            //document.getElementById("fileStr").value = '<img src="'+this.result+'" alt=""/>';
            //img_area.innerHTML = '<div class="sitetip">图片img标签展示：</div><img src="'+this.result+'" alt=""/>';
            //console.log($("#fileStr").val());
            $("#fileType").val(file.type);
            //alert(file.type);
            $("#showImageInfoImg").attr("src", this.result);
        }
    }

//    var input1 = document.getElementById("image_file_input");
//    //var result =  document.getElementById("fileStr1");
//    //var img_area = document.getElementById("img_area");
//    if (typeof(FileReader) === 'undefined') {
//        alert("抱歉，你的浏览器不支持 FileReader，请使用现代浏览器操作！");
//        input1.setAttribute('disabled', 'disabled');
//    } else {
//        input1.addEventListener('change', readFile1, false);
//    }
//
//    function readFile1() {
//
//        var file = this.files[0];
//        if(file == undefined) {
//            //layer.msg("发送内容过大，请检查图片和内容");
//            $("#showImageInfoImg1").attr("src",img64);
//            $("#fileStr1").val("");
//            $("#fileType1").val("");
//            return;
//        }
//        //这里我们判断下类型如果不是图片就返回 去掉就可以上传任意文件
//        if (!/image\/\w+/.test(file.type)) {
//            layer.msg("请确保文件为图像类型");
//            return false;
//        }
//        var reader = new FileReader();
//        reader.readAsDataURL(file);
//        reader.onload = function (e) {
//            $("#fileStr1").val(this.result);
//            //document.getElementById("fileStr").value = '<img src="'+this.result+'" alt=""/>';
//            //img_area.innerHTML = '<div class="sitetip">图片img标签展示：</div><img src="'+this.result+'" alt=""/>';
//            //alert($("#fileStr").val());
//            $("#fileType1").val(file.type);
//            //alert(file.type);
//            $("#showImageInfoImg1").attr("src", this.result);
//        }
//    }

    var reload = function () {
//        $(grid_selector).jqGrid('clearGridData');  //清空表格
        $(grid_selector).jqGrid('setGridParam',{
            url:"${contextPath}/ktSaleProject/getMemberListByPage",
            datatype:'json',
//                    postData:param,
            page:1
        }).trigger("reloadGrid"); //重新载入
    }

</script>

<!-- jqGrid 公用方法 -->
<script type="application/javascript">
    //it causes some flicker when reloading or navigating grid
    //it may be possible to have some custom formatter to do this as the grid is being created to prevent this
    //or go back to default browser checkbox styles for the grid
    function styleCheckbox(table) {
        /**
         $(table).find('input:checkbox').addClass('ace')
         .wrap('<label />')
         .after('<span class="lbl align-top" />')


         $('.ui-jqgrid-labels th[id*="_cb"]:first-child')
         .find('input.cbox[type=checkbox]').addClass('ace')
         .wrap('<label />').after('<span class="lbl align-top" />');
         */
    }


    //unlike navButtons icons, action icons in rows seem to be hard-coded
    //you can change them like this in here if you want
    function updateActionIcons(table) {
        /**
         var replacement =
         {
             'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',
             'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',
             'ui-icon-disk' : 'ace-icon fa fa-check green',
             'ui-icon-cancel' : 'ace-icon fa fa-times red'
         };
         $(table).find('.ui-pg-div span.ui-icon').each(function(){
				var icon = $(this);
				var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
				if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
			})
         */
    }

    //replace icons with FontAwesome icons like above
    function updatePagerIcons(table) {
        var replacement =
            {
                'ui-icon-seek-first': 'ace-icon fa fa-angle-double-left bigger-140',
                'ui-icon-seek-prev': 'ace-icon fa fa-angle-left bigger-140',
                'ui-icon-seek-next': 'ace-icon fa fa-angle-right bigger-140',
                'ui-icon-seek-end': 'ace-icon fa fa-angle-double-right bigger-140'
            };
        $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function () {
            var icon = $(this);
            var $class = $.trim(icon.attr('class').replace('ui-icon', ''));

            if ($class in replacement) icon.attr('class', 'ui-icon ' + replacement[$class]);
        })
    }

    function enableTooltips(table) {
        $('.navtable .ui-pg-button').tooltip({container: 'body'});
        $(table).find('.ui-pg-div').tooltip({container: 'body'});
    }
</script>

<!-- jqGrid 数据加载 -->
<script type="text/javascript">
    var scripts = [null, "${contextPath}/static/ace/components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js", "${contextPath}/static/ace/components/jqGrid/js/jquery.jqGrid.js", "${contextPath}/static/ace/components/jqGrid/js/i18n/grid.locale-cn.js", "${contextPath}/static/layer/layer.js", null]
    $('.page-content-area').ace_ajax('loadScripts', scripts, function () {
        jQuery(function ($) {

            var parent_column = $(grid_selector).closest('[class*="col-"]');
            //resize to fit page size
            $(window).on('resize.jqGrid', function () {
                $(grid_selector).jqGrid('setGridWidth', parent_column.width());
            })

            //resize on sidebar collapse/expand
            $(document).on('settings.ace.jqGrid', function (ev, event_name, collapsed) {
                if (event_name === 'sidebar_collapsed' || event_name === 'main_container_fixed') {
                    //setTimeout is for webkit only to give time for DOM changes and then redraw!!!
                    setTimeout(function () {
                        $(grid_selector).jqGrid('setGridWidth', parent_column.width());
                    }, 20);
                }
            })

            jQuery(grid_selector).jqGrid({
                //direction: "rtl",

                //subgrid options
                subGrid: false,
                url: "${contextPath}/ktSaleProject/getMemberListByPage",
                //data: grid_data,
                datatype: "json",
                mtype: 'POST',
                height: 350,
                colNames: ['Id', '会员Id', '姓名', '年龄', '性别Id', '性别', '电话','手机', '状态', '当前积分','历史积分', '创建时间', 'lastShopId', '最后光顾店铺', '最后光顾时间', '头像', '备注', '发卡人', '助记码', '身份证'],
//             "birthday" -> "null"
//             "createTime" -> "2018-01-23 16:45:33"
//            "totalPoint" -> "null"
//            "balanceAmt" -> "null"
//            "faceId" -> "26441516697133679"
//            "lastShopId" -> "null"
//            "remark" -> "null"
//            "lastShoppingTime" -> "null"
//            "state" -> "1"
//            "extraData" -> "group1/M00/00/00/CgrI8lpm9i2ADiswAAAK4KAjtXw054.txt"
//            "id" -> "25CA6849EE3D46BBBF621B8812C34B80"
//            "createUser" -> "null"
//            "shopId" -> "2644"
//            "modifyUser" -> "null"
//            "age" -> "32"
//            "userId" -> "3"
//            "helpCode" -> "null"
//            "gender" -> "0"
//            "userName" -> "null"
//            "usedPoint" -> "null"
//            "modifyTime" -> "null"
//            "mobile" -> "null"
                colModel: [
                    {
                        name: 'id',
                        index: 'id',
                        editable: true,
                        hidden:true,
                        align:'center',
                    },
                    {
                        name: 'userId',
                        index: 'userId',
                        editable: true,
                        hidden: true,
                        align:'center',
                        formatter: function (v, x, r) {
                            var userId = r['userId'];
                            if(!userId){
                                return '-';
                            }
                            return userId;
                        },
//                        formatter: cLink
                    },
                    {
                        name: 'userName',
                        index: 'userName',
                        editable: true,
                        sortable: false,
                        editrules: {required: true},
                        formatter: function (v, x, r) {
                            var userName = r['userName'];
                            if(!userName){
                                return '-';
                            }
                            return userName;
                        }
                    },
                    {
                        name: 'age',
                        index: 'age',
                        editable: true,
                        sortable: false,
                        editrules: {required: true},
                        formatter: function (v, x, r) {
                            var age = r['age'];
                            if(!age){
                                return '-';
                            }
                            return age;
                        }
                    },
                    {
                        name: 'gender',
                        index: 'gender',
                        editable: true,
                        hidden:true,
                        sortable: false,
                        editrules: {required: true}
                    },
                    {
                        name: 'genderName',
                        index: 'genderName',
                        editable: true,
                        sortable: false,
                        align: 'center',
                        edittype: 'select',
                        formatter: function (v, x, r) {
                            var gender = r['gender'];
                            if (gender == '1'){
                                return '男'
                            }
                            if (gender == '2'){
                                return '女'
                            }
                            return '-'
                        }
                    },
                    {
                        name: 'phone', index: 'phone', editable: false, sortable: false, hidden: true,
                        formatter: function (v, x, r) {
                            var phone = r['phone'];
                            if(!phone){
                                return '-';
                            }
                            return phone
                        }
                    },
                    {
                        name: 'mobile',
                        index: 'mobile',
                        editable: true,
                        sortable: false,
                        editrules: {required: true},
                        formatter: function (v, x, r) {
                            if(!v){
                                return '-';
                            }
                            return '<a href="${contextPath}/goto/memberInfo?mobile='+v+'" onclick="">'+v+'</a>'
                        },
                    },

                    {
                        name: 'state',
                        index: 'state',
                        editable: true,
                        sortable: false,
                        edittype: 'select',
                        formatter: function (v, x, r) {
                            var state = r['state'];
                            if (state == '1'){
                                return '有效'
                            }
                            if (state == '0'){
                                return '无效'
                            }
                            if (state == '2'){
                                return '业务冻结'
                            }
                            if (state == '3'){
                                return '财务冻结'
                            }
                            if (state == '4'){
                                return '停用'
                            }
                            return '-';
                        }
                    },
                    {
                        name: 'totalPoint',
                        index: 'totalPoint',
                        editable: true,
                        sortable: false,
                        edittype: 'select',
                        formatter: function (v, x, r) {
                            var totalPoint = r['totalPoint'];
                            if (!totalPoint){
                                return '-';
                            }
                            return totalPoint;
                        }
                    },{
                        name: 'integral',
                        index: 'integral',
                        editable: true,
                        sortable: false,
                        edittype: 'select',
                        formatter: function (v, x, r) {
                            var totalPoint = r['integral'];
                            if (!totalPoint){
                                return '-';
                            }
                            return totalPoint;
                        }
                    },
                    {
                        name: 'createTime',
                        index: 'createTime',
                        editable: true,
                        hidden: true,
                        sortable: false,
                    },
                    {
                        name: 'lastShopId',
                        index: 'lastShopId',
                        editable: true,
                        hidden: true,
                        sortable: false,
                    },
                    {
                        name: 'lastShopName',
                        index: 'lastShopName',
                        editable: true,
                        sortable: false,
                        formatter: function (v, x, r) {
                            var lastShopName = r['lastShopName'];
                            if(!lastShopName){
                                return '-';
                            }
                            return lastShopName
                        },
                    },
                    {
                        name: 'lastShoppingTime', index: 'lastShoppingTime', editable: true, sortable: false,
                        formatter: function (v, x, r) {
                            var lastShoppingTime = r['lastShoppingTime'];
                            if(!lastShoppingTime){
                                return '-';
                            }
                            return lastShoppingTime
                        },
                    },
                    {name: 'extraData', index: 'extraData', editable: true, sortable: false, hidden: true,},
                    {name: 'remark', index: 'remark', editable: true, sortable: false, hidden: true,},
                    {name: 'createUser', index: 'createUser', editable: true, sortable: false, hidden: true,},
                    {name: 'helpCode', index: 'createUser', editable: true, sortable: false, hidden: true,},
                    {name: 'certNo', index: 'certNo', editable: true, sortable: false,},
                ],

                rownumbers: true, //自动行数
//                        width:"1000",
                autowidth:true,  //宽度自适应
//                        height:"100%",   //高度自适应
                viewrecords: true,
                rowNum : 10,//一页显示多少条
                rowList : [ 10, 20, 30 ],//可供用户选择一页显示多少条
                pager : pager_selector,//表格页脚的占位符(一般是div)的id
                sortname : 'gmtModifiedStr',//初始化的时候排序的字段
                sortorder : "desc",//排序方式,可选desc,asc
//                mtype : "post",//向后台请求数据的ajax的类型。可选post,get
                altRows: true,
//                toppager: true,
                multiselect: false,
                //multikey: "ctrlKey",
                multiboxonly: false,

                loadComplete: function () {
                    var table = this;
                    setTimeout(function () {
                        styleCheckbox(table);

                        updateActionIcons(table);
                        updatePagerIcons(table);
                        enableTooltips(table);
                    }, 0);
                },

                editurl: "${contextPath}/ktPurchase/saveSupplier",//nothing is saved
                caption: "会员列表",
                jsonReader: {
                    root: "recordList",
                    page: "currentPage",
                    total: "pageCount",
                    records: "recordCount"
                }

                //,autowidth: true,


                /**
                 ,
                 grouping:true,
                 groupingView : {
				 groupField : ['name'],
				 groupDataSorted : true,
				 plusicon : 'fa fa-chevron-down bigger-110',
				 minusicon : 'fa fa-chevron-up bigger-110'
			},
                 caption: "Grouping"
                 */

            });

            $(window).triggerHandler('resize.jqGrid');//trigger window resize to make the grid get the correct size


            function cLink(cellvalue, options, rowObject){
//                //console.log(rowObject)
                var id = rowObject.id;
                return '<a href="${contextPath}/sys/user/home#page/franchiseePrementSupplierSuppliercoommdity&id='+id+'" onclick="">'+id+'</a>';
            }


            /**
             * 修改某条信息
             */
            $("#editmembers").click(function () {
                var id = $(grid_selector).jqGrid('getGridParam', 'selrow');
                if (!id) {
                    layer.msg("提示：请选择一条信息");
                    return;
                }

                var rowData = $(grid_selector).jqGrid('getRowData', id);
                editmembers(rowData)
                reload();

            });

            /**
             * 删除某条数据
             */
            $("#deleteSupplier").click(function () {
                var id = $(grid_selector).jqGrid('getGridParam', 'selrow');

                if (!id) {
                    layer.msg("提示：请选择一条信息");
                    return;
                }
//询问框
                layer.confirm('将会把这条供应商数据删除', {
                    btn: ['确定', '取消'] //按钮
                }, function () {
                    var rowData = $(grid_selector).jqGrid('getRowData', id);
                    rowData.id = rowData.id.split('>')[1].split('<')[0];
                    queryModel.id = rowData.id;
                    layer.load(1);
                    $.ajax({
                        url: '${contextPath}/ktPurchase/deleteSupplier',
                        type: 'post',
                        data: queryModel,
                        dataType: 'json',
                        success: function (data) {
                            layer.closeAll('loading');
                            if (data.success) {
                                layer.msg('删除成功', {icon: 1});

                            } else {
                                layer.msg(data.message);
                            }
                            reload();

                        },
                        error: function (error) {
                            layer.closeAll('loading');
                            $.jgrid.info_dialog("提示：", "服务器异常，稍后再试");
                        }

                    })

                }, function () {
                });
            });



        });
    });
</script>

<!-- 模态框 -->
<script>

    /*** input 实时监控 *****/
    $('#mobile').bind('input propertychange', function() {
        var mobile = $(this).val()
        if(!phoneVarify(mobile)){
            $(this).attr('data-content','手机格式不正确！');
            $("#mobile").popover('show');
        }else {
            $("#mobile").popover('hide');
        }
    });

    $('#certNo').bind('input propertychange', function() {
        var certNo = $(this).val()
        if(!certNoVerify(certNo)){
            $(this).attr('data-content','身份证格式不正确！');
            $("#certNo").popover('show');
        }else {
            $("#certNo").popover('hide');
        }
    });

    /**************/


    jQuery(function($){
        //解决模态框背景色越来越深的问题
        $(document).on('show.bs.modal', '.modal', function(event) {
            $(this).appendTo($('body'));
        }).on('shown.bs.modal', '.modal.in', function(event) {
            setModalsAndBackdropsOrder();
        }).on('hidden.bs.modal', '.modal', function(event) {
            setModalsAndBackdropsOrder();
        });

        function setModalsAndBackdropsOrder() {
            var modalZIndex = 1040;
            $('.modal.in').each(function(index) {
                var $modal = $(this);
                modalZIndex++;
                $modal.css('zIndex', modalZIndex);
                $modal.next('.modal-backdrop.in').addClass('hidden').css('zIndex', modalZIndex - 1);
            });
            $('.modal.in:visible:last').focus().next('.modal-backdrop.in').removeClass('hidden');
        }

        //覆盖Modal.prototype的hideModal方法
        $.fn.modal.Constructor.prototype.hideModal = function () {
            var that = this
            this.$element.hide()
            this.backdrop(function () {
                //判断当前页面所有的模态框都已经隐藏了之后body移除.modal-open，即body出现滚动条。
                $('.modal.fade.in').length === 0 && that.$body.removeClass('modal-open')
                that.resetAdjustments()
                that.resetScrollbar()
                that.$element.trigger('hidden.bs.modal')
            })
        }
    });

    /**********  模态框相关设置  **********/
    function centerModals() {
        $('#myModal').each(function(i) {
            var $clone = $(this).clone().css('display','block').appendTo('body');
            var top = Math.round(($clone.height() - $clone.find('.modal-content').height()) / 2);
            top = top > 0 ? top : 0;
            $clone.remove();
            $(this).find('.modal-content').css("margin-top", top);
        });
    };

    $('#myModal').on('show.bs.modal', centerModals);
    //禁用空白处点击关闭
    $('#myModal').modal({
        backdrop: 'static',
        keyboard: false,//禁止键盘
        show:false
    });
    //页面大小变化是仍然保证模态框水平垂直居中
    $(window).on('resize', centerModals);
    /*************************************/

</script>

<!-- 模态框 -->
<script type="text/javascript">
    $("#editState").click(function () {
        var id = $(grid_selector).jqGrid('getGridParam', 'selrow');
        if (!id) {
            layer.msg("提示：请选择一条信息");
            return;
        }
        var rowData = $(grid_selector).jqGrid('getRowData', id);
        $('#example1').modal('show');
    });

    $("#saveState").click(function () {
        var id = $(grid_selector).jqGrid('getGridParam', 'selrow');
        var rowData = $(grid_selector).jqGrid('getRowData', id);
        var data = {};
        data.id = id;
        data.state = $("#state1").val();
        getObjects(data);
        $('#example1').modal('hide');
    })
</script>

<!-- 店铺加载 -->
<script type="text/javascript">
    // 加载店铺列表



    var requireShopId = '';
    var requireShopName = '';
    function pageInit(productCode){
//        var filters = {
//            "rules": [
//                {
//                    "field" : "state",
//                    "data": '1'
//                }
//            ]
//        };
//        var dataArray = []
//        dataArray.filters = JSON.stringify(filters);

        //console.log(queryModel)
        requireShopName = "#requireShopName_"+productCode;
        requireShopId = "#requireShopId_"+productCode;

        jQuery(grid_shop_selector).jqGrid({
            subGrid: false,
            url : '${contextPath}/ktProd/getShopListByPage',
            datatype: "json",
            postData: queryModel,
            mtype: 'POST',
            height: 300,
            colNames: ['店铺编号', '店铺名称'],
            colModel: [
                {name: 'shopId', index: 'shopId', width: 200, editable: true, key: true},
//                    {
//                        name: 'row',
//                        index: 'row',
//                        width: 90,
//                        editable: true,
//                        sortable: false,
//                        editrules: {required: true}
//                    },
                {
                    name: 'shopName',
                    index: 'shopName',
                    width: 350,
                    editable: true,
                    sortable: false,
                    editrules: {required: true}
                }

            ],
//                rownumbers: true, //自动行数
            height:"100%",   //高度自适应
//			width: "100%",
            autowidth: true,  //宽度自适应
//            viewrecords: true,
            rowNum: 10,
            rowList: [10, 20, 30],
            pager: pager_shop_selector,
            altRows: true,
            //toppager: true,

            multiselect: true,
            //multikey: "ctrlKey",
            multiboxonly: false,

            loadComplete: function () {
                var table = this;
                setTimeout(function () {
                    styleCheckbox(table);

                    updateActionIcons(table);
                    updatePagerIcons(table);
                    enableTooltips(table);
                }, 0);
            },

            editurl: "${contextPath}/ktProd/getShopListByPage",//nothing is saved
//            caption: "店铺列表",
            jsonReader: {
                root: "recordList",
                page: "currentPage",
                total: "pageCount",
                records: "recordCount"
            },
            ondblClickRow: function () {
                var shopId = $(grid_shop_selector).jqGrid('getGridParam', 'selrow');
                var rowData = $(grid_shop_selector).jqGrid('getRowData', shopId);

                var shopId = $("#shopId").val();
                if (shopId == rowData.shopId){
                    layer.msg("提示：商品来源不能选择自己")
                    return
                }
                setInput(rowData)
                $('#myModal1').modal('hide');
            }

//                onSelectAll: function(rowids,statue){
//                    //函数里做自己的处理
//					queryModel.rowIds = rowids;
//                },
//                resetSelection: function(rowid){
//
//                    return(rowid)
//				}

            //,autowidth: true,


            /**
             ,
             grouping:true,
             groupingView : {
				 groupField : ['name'],
				 groupDataSorted : true,
				 plusicon : 'fa fa-chevron-down bigger-110',
				 minusicon : 'fa fa-chevron-up bigger-110'
			},
             caption: "Grouping"
             */

        });
        //it causes some flicker when reloading or navigating grid
        //it may be possible to have some custom formatter to do this as the grid is being created to prevent this
        //or go back to default browser checkbox styles for the grid
        function styleCheckbox(table) {
            /**
             $(table).find('input:checkbox').addClass('ace')
             .wrap('<label />')
             .after('<span class="lbl align-top" />')


             $('.ui-jqgrid-labels th[id*="_cb"]:first-child')
             .find('input.cbox[type=checkbox]').addClass('ace')
             .wrap('<label />').after('<span class="lbl align-top" />');
             */
        }


        //unlike navButtons icons, action icons in rows seem to be hard-coded
        //you can change them like this in here if you want
        function updateActionIcons(table) {
            /**
             var replacement =
             {
                 'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',
                 'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',
                 'ui-icon-disk' : 'ace-icon fa fa-check green',
                 'ui-icon-cancel' : 'ace-icon fa fa-times red'
             };
             $(table).find('.ui-pg-div span.ui-icon').each(function(){
				var icon = $(this);
				var $class = $.trim(icon.attr('class').replace('ui-icon', ''));
				if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);
			})
             */
        }

        //replace icons with FontAwesome icons like above
        function updatePagerIcons(table) {
            var replacement =
                {
                    'ui-icon-seek-first': 'ace-icon fa fa-angle-double-left bigger-140',
                    'ui-icon-seek-prev': 'ace-icon fa fa-angle-left bigger-140',
                    'ui-icon-seek-next': 'ace-icon fa fa-angle-right bigger-140',
                    'ui-icon-seek-end': 'ace-icon fa fa-angle-double-right bigger-140'
                };
            $('.ui-pg-table:not(.navtable) > tbody > tr > .ui-pg-button > .ui-icon').each(function () {
                var icon = $(this);
                var $class = $.trim(icon.attr('class').replace('ui-icon', ''));

                if ($class in replacement) icon.attr('class', 'ui-icon ' + replacement[$class]);
            })
        }

        function enableTooltips(table) {
            $('.navtable .ui-pg-button').tooltip({container: 'body'});
            $(table).find('.ui-pg-div').tooltip({container: 'body'});
        }

        //var selr = jQuery(grid_selector).jqGrid('getGridParam','selrow');

        $(document).one('ajaxloadstart.page', function (e) {
            $.jgrid.gridDestroy(grid_selector);
            $('.ui-jqdialog').remove();
        });

        $(window).triggerHandler('resize.jqGrid');//trigger window resize to make the grid get the correct size
    }

    var setInput = function (rowData) {
        console.log(rowData)
        $("#shopName").val(rowData.shopName);
        $("#shopId").val(rowData.shopId);
    }
</script>